package com.example.radiationarea.block;

import com.example.radiationarea.RadiationAreaMod;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class ModBlocks {
    // \u521B\u5EFA\u65B9\u5757\u6CE8\u518C\u5668
    public static final DeferredRegister<Block> BLOCKS = 
            DeferredRegister.create(ForgeRegistries.BLOCKS, RadiationAreaMod.MOD_ID);

    // \u6CE8\u518C\u88AB\u6C61\u67D3\u7684\u6CE5\u571F\u65B9\u5757
    public static final RegistryObject<Block> CONTAMINATED_DIRT = BLOCKS.register("contaminated_dirt",
            () -> new ContaminatedDirtBlock(BlockBehaviour.Properties.of(Material.DIRT, MaterialColor.COLOR_GREEN)
                    .strength(0.5f)  // \u8BBE\u7F6E\u786C\u5EA6
                    .sound(SoundType.GRAVEL)  // \u8BBE\u7F6E\u58F0\u97F3\u4E3A\u6CE5\u571F\u58F0\u97F3
                    .requiresCorrectToolForDrops())); // \u9700\u8981\u6B63\u786E\u7684\u5DE5\u5177\u624D\u80FD\u6389\u843D

    // \u6CE8\u518C\u65B9\u6CD5
    public static void register(IEventBus eventBus) {
        BLOCKS.register(eventBus);
    }
}